package cn.wdm.ymcc.feign;

import cn.wdm.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFallBackFactory implements FallbackFactory<MediaFeignClient> {

    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient() {
            @Override
            public JSONResult getMediasByChapterId(Long chapterId) {
                return JSONResult.error("服务不可达");
            }
        };
    }
}
